from django.db import models
from account.models import UserRole, NewUser
from new_admin.models import ClassGrade

# Create your models here.
class Punish(models.Model):
    student = models.ForeignKey(NewUser, on_delete=models.CASCADE, related_name='students')
    teacher = models.ForeignKey(NewUser, on_delete=models.CASCADE, related_name='teachers')
    violate_content = models.TextField()
    choice = (
        ('1', '审请'),
        ('2', '申请通过'),
        ('3', '申请未通过')
    )
    state = models.PositiveSmallIntegerField(default=1, choices=choice)
    violate_date = models.DateField(auto_now=True)
    apply_date = models.DateField(auto_now_add=True)
    check_date=models.DateField(null=True)

class Inview(models.Model):
    classes = models.ForeignKey(ClassGrade, on_delete=models.CASCADE)
    student = models.ForeignKey(NewUser, on_delete=models.CASCADE, related_name='student')
    teacher = models.ForeignKey(NewUser, on_delete=models.CASCADE, related_name='teacher')
    handle = models.CharField(max_length=100)
    content = models.TextField()
    result = models.CharField(max_length=20)
    interview_date=models.DateField(auto_now=True)
    add_date = models.DateField(auto_now_add=True)